<ion-header>
  <ion-navbar>
    <ion-title>打开外部链接</ion-title>
    <ion-buttons>
      <button ion-button (click)="dismiss()">
        <ion-icon name="arrow-back"></ion-icon>
      </button>
    </ion-buttons>
  </ion-navbar>
</ion-header>
<ion-content >
  <ion-segment [(ngModel)]="chooseType" color="primary" (ionChange)="segmentChanged($event)">
    <ion-segment-button value="handle">
      所需插件
    </ion-segment-button>
    <ion-segment-button value="test">
      真机调试
    </ion-segment-button>
  </ion-segment>
  <div *ngIf="chooseType=='handle'">
    <ion-list>
    <ion-item-sliding *ngFor="let item of showArr">
      <ion-item>
          {{item.text}}
      </ion-item>
      <ion-item-options side="right">
          <button ion-button> {{item.tips}}</button>
        </ion-item-options>
    </ion-item-sliding>
    </ion-list>
    <textarea disabled rows="10">
        import { InAppBrowser } from '@ionic-native/in-app-browser';
        constructor(private iab: InAppBrowser) { }
        const browser = this.iab.create('https://ionicframework.com/');
        browser.executeScript(...);
        browser.insertCSS(...);
        browser.on('loadstop').subscribe(event => {
           browser.insertCSS({ code: "body{color: red;" });
        });
        browser.close();
    </textarea>
  </div>
  <div *ngIf="chooseType=='test'">
      <ion-item>
          <ion-label color="primary" fixed>跳转https://</ion-label>
         <ion-input type="tel" placeholder="www.baidu.com" [(ngModel)]="goUrl"></ion-input>
        </ion-item>
      <button ion-button full (click)="goOutUrl()">跳转</button>
  </div>
</ion-content>
